import { resolve } from 'path';
import { defineConfig } from 'vite';

export default defineConfig({
  server: {
    host: '0.0.0.0',
    open: true,
  },
  resolve: {
    alias: {
      '@': resolve(__dirname, './lib'),
    },
  },
  build: {
    minify: false,
    lib: {
      entry: resolve(__dirname, 'lib/index.js'),
      name: 'Designer',
      fileName: (format) => `designer.${format}.js`,
    },
    // target: 'es2015',
    // outDir: 'dist-html',
    // assetsDir: './',
    // cssCodeSplit: true,
    // chunkSizeWarningLimit: 1500,
    // assetsInlineLimit: 99999,
    // rollupOptions: {
    //   input: {
    //     app: resolve(__dirname, 'index.html'),
    //   },
    //   output: {
    //     entryFileNames: '[name].[hash].js',
    //     chunkFileNames: '[name].[hash].js',
    //     assetFileNames: '[name].[hash][extname]',
    //   },
    // },
  },
});
